﻿@model Lehnet.Models.Ilce
<html>
<head>
    <script type="text/javascript" src="/Scripts/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.unobtrusive-ajax.js"></script>
    <script>
        function CloseAndUpdate() {
            parent.getallIlceAjax();
            parent.jQuery.fancybox.close();
        }
        function OnSuccess(result, status, xhr) {

            CloseAndUpdate();
        }
    </script>

</head>
<body>

    <div style="width: 100%; text-align: right;">
        <a href="#" title="Kapat" onclick="CloseAndUpdate()">
            <input type="button" value="Kapat" /></a>
    </div>
    @using (Ajax.BeginForm("Create", new AjaxOptions { OnSuccess = "OnSuccess", HttpMethod = "Post" }))
    {
        @Html.ValidationSummary(true)
        <h2>@ViewBag.ResultMessage</h2>
        <fieldset>
            <legend>Ilce</legend>
            <input type="hidden" value="@ViewBag.SehirId" name="IlId"/>
            <div class="editor-label">
                @Html.LabelFor(model => model.Ad)
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Ad)
                @Html.ValidationMessageFor(model => model.Ad)
            </div>

            <div class="editor-label">
                @Html.LabelFor(model => model.Aktif)
            </div>
            <div class="editor-field">
                @Html.CheckBoxFor(model => model.Aktif)
                @Html.ValidationMessageFor(model => model.Aktif)
            </div>
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>
        <input type="hidden" value="@ViewBag.SehirId" name="IlId" id="IlId" />
    }
</body>

</html>

